<!-- 展示一条信息的,展示我的这边组件 -->
<template>
	<view class="message flex">
		<image v-if="data.image" class="message-img" :src="data.image" mode="aspectFill"></image>
		<view class="message-text" v-if="data.mes">
			{{ data.mes }}
		</view>
		<image :src="data.avatar" mode="aspectFill" class="message-avatar"></image>
		
	</view>
</template>

<script setup>
	const props = defineProps({
		data: {
			type: Object,
			default: () => ({})
		}
	})
</script>

<style lang="scss" scoped>
.message{
	margin-bottom: 30rpx;
	justify-content: flex-end;
	&-avatar{
		align-self: flex-start;
		width: 60rpx;
		height: 60rpx;
		margin-left:24rpx;
		border-radius: 50%;
	}
	
	&-img{
		width: 250rpx;
		height: 250rpx;
	}
	
	&-text{
		width: 471rpx;
		padding: .8em;
		border-radius: 10rpx;
		font-size: 24rpx;
		color: #333333;
		background-color: #fff;
	}
}
</style>
